]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
loginManager: Create session proxy asynchronously
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 13 Feb 2025 01:53:02 +0000 (02:53 +0100)
committerMarge Bot <marge-bot@gnome.org>
Thu, 13 Feb 2025 11:31:34 +0000 (11:31 +0000)
Most of the function is already asynchronous, except for the
initialization of the returned proxy. gjs' D-Bus wrapper gained
some convenience API a while ago that makes this trivial enough,
so use it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3636>

js/misc/loginManager.js

index 46514849233cb18255cbd29555343e1ecfee4e39..4bbe7c42cd7ee9d7a02f61fda301bfd7a8164c8b 100644 (file)
@@ -143,8 +143,8 @@ class LoginManagerSystemd extends Signals.EventEmitter {
 
         try {
             const [objectPath] = await this._proxy.GetSessionAsync(sessionId);
-            this._currentSession = new SystemdLoginSession(Gio.DBus.system,
-                'org.freedesktop.login1', objectPath);
+            this._currentSession = await SystemdLoginSession.newAsync(
+                Gio.DBus.system, 'org.freedesktop.login1', objectPath);
             return this._currentSession;
         } catch (error) {
             logError(error, 'Could not get a proxy for the current session');